package com.sihai.ehr.model.biz;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;

import com.sihai.core.BaseEntity;
import com.sihai.ehr.model.sys.Organization;

/**
 * 培训教具实体对象
 * 
 * @author henry
 * 
 */
@Entity
public class TrainRealiaResource extends BaseEntity<Long> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	/** 组织结构ID */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "organization_id")
	private Organization organization;

	/** 培训计划ID */
	@ManyToMany(cascade = { CascadeType.ALL }, mappedBy = "realiaResources", targetEntity = TrainPlan.class)
	private Set<TrainPlan> trainPlans = new HashSet<TrainPlan>();

	/** 名称 */
	private String name;

	@Override
	public Long getId() {
		// TODO Auto-generated method stub
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Organization getOrganization() {
		return organization;
	}

	public void setOrganization(Organization organization) {
		this.organization = organization;
	}

//	public void setTrainPlans(Set<TrainPlan> trainPlans) {
//		this.trainPlans = trainPlans;
//	}
	
	public Set<TrainPlan> getTrainPlans() {
		return trainPlans;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
